function insertion(array) {
    for (let i = 1; i < array.length; i++) {
        let start_index = i
        while (start_index > 0){
            if(array[start_index]<array[start_index-1]){
                let temp = array[start_index]
                array[start_index] = array[start_index-1]
                array[start_index-1] = temp
            }
            start_index--
        }
    }
}
let array = [100, 23, 45, 12, 25, 3, 90, 34]
insertion(array)
console.log(array)